package com.jiangcheng.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jiangcheng.bean.User;
import com.jiangcheng.configuration.UserMapper;
import com.jiangcheng.service.UserService;

//@Service("userService")
@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	
	@Override
	public boolean login(User user) {
		int result = userMapper.login(user);
		if(result > 0){
			return true;
		}else{
			return false;
		}
		
	}

	@Override
	public User selectUser(long userId) {
		return userMapper.selectUserById((int)userId);
	}

    @Override
    public void addUser() {
		System.out.println("static_factory add user");
    }

    public void init(){
		System.out.println("初始化");
	}

	public void destroy(){
		System.out.println("销毁");
	}
}
